package com.example.design.bilibili.command;

/**
 * 开灯命令类
 */
public class LightOnCommand implements Command{

    //聚合LightReciever

    LightReceiver light;

    public LightOnCommand(LightReceiver light) {
        super();
        this.light = light;
    }

    @Override
    public void execute() {

        //调用接收者的方法
        light.on();
    }

    @Override
    public void undo() {

        //调用接收者的方法
        light.off();
    }
}
